libxl: fix issues in 38cd0664
authorWei Liu <wei.liu2@citrix.com>
Mon, 3 Oct 2016 14:46:02 +0000 (15:46 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 4 Oct 2016 09:53:41 +0000 (10:53 +0100)
commit031655daea9bb0f69ce54a32fea0eab319471d04
treedd4c0ce71b4c9b39e382b9ae410b4ea806ec27a2
parent40277cded320efa32b86c0c9f01e33145eab5ee4
libxl: fix issues in 38cd0664

A few issues were introduced in 38cd0664 ("libxl/arm: Add the size of
ACPI tables to maxmem"):

1. d_config was not properly initialised and disposed of.
2. using libxl_retrieve_domain_configuration caused thread to
   deadlock itself.

Fix those issues by:

1. properly initialise and dispose of d_config.
2. switch to use libxl__get_domain_configuration.

Note that in theory we can refactor libxl_retrieve_domain_configuration
a bit to get a function without locking, but up until the calculation of
extra memory only relies on static configuration, hence we use the
stored configuration only.

Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c